package com.csx.distributed.invoke.rpc.core.proxy.jdk;


import com.csx.distributed.invoke.rpc.core.proxy.ProxyFactory;

import java.lang.reflect.Proxy;

/**
 * @author cuisongxu
 * @date 2025/9/1 周一 17:49
 */
public class JDKProxyFactory implements ProxyFactory {

    @Override
    public <T> T getProxy(Class clazz) throws Throwable {
        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz},
                new JDKClientInvocationHandler(clazz));
    }
}
